var http = require("http");
var fs = require("fs");

var server = http.createServer(function(req,res){
    if(req.url.startsWith("/login")){
         res.setHeader("Content-Type","text/html");
       if(req.url.indexOf("?") > -1){
          //处理登陆
            res.end("<h1>登陆成功了呀！</h1>");
            }else{
                  
                   fs.readFile(".test.html",function(err,data){

                        res.end(data);                                      
                                                              });
                  // res.setHeader("Content-Type","text/html");
                  // res.end("<html>.....登陆页面的？html");
                  }   
                                     }else if(req.url.startWith("/reg")){
                                        //处理注册
                                     
}


     });

server listen(3000);
